<script>
// h5 页面路由动画
import pageAnimation from "components/official/page-animation";
import * as Types from "store/constants";

export default {
  mixins: [pageAnimation],
  onLaunch: function () {
    // 网络监听
    this.lib.NetWork.On();

    // 保存本地数据到内存
    const user = uni.getStorageSync("user");
    if (user) {
      this.$store.dispatch(Types.authLoginAction);
      this.$store.dispatch(Types.getUserDataAction, user.id);
      this.$store.dispatch(Types.getUserDescAction, user.id);
    }
  },
  onShow: function () {
    console.log("App Show");
  },
  onHide: function () {
    console.log("App Hide");
  },
};
</script>

<style lang="scss">
/*每个页面公共css */
@import "./common/css/uni.css";
/* 公共图标库 */
@import "./common/css/icon.css";
/* 动画库 */
@import "./common/css/animate.css";
/* 封装样式库 */
@import "./common/scss/common.scss";
</style>
